;--------------------------------------------------------
; File Created by SDCC : free open source ANSI-C Compiler
; Version 2.9.0 #5416 (Feb  3 2010) (UNIX)
; This file was generated Thu May 12 01:17:15 2011
;--------------------------------------------------------
; PIC16 port for the Microchip 16-bit core micros
;--------------------------------------------------------

	.ident "SDCC version 2.9.0 #5416 [pic16 port]"
	.file	"protocol.c"
	list	p=18f2550

	radix dec

;--------------------------------------------------------
; public variables in this module
;--------------------------------------------------------
	global _init_protocol
	global _get_protocol_data
	global _add_to_protocol_decoder
	global _add_packet_to_protocol_encoder
	global _decode_frame
	global _encode_frame
	global _protocol_packets
	global _protocol_frame
	global _src
	global _dst
	global _state

;--------------------------------------------------------
; extern variables in this module
;--------------------------------------------------------
	extern __gptrput1
	extern __gptrget1
	extern __moduchar
	extern __divuchar
	extern _stdin
	extern _stdout
	extern _crc16
	extern _sprintf
	extern _strcat
	extern _strcpy
	extern _strlen
	extern _strncat
	extern _memcpy
	extern _strtol
	extern __divsint
	extern __mulint
;--------------------------------------------------------
;	Equates to used internal registers
;--------------------------------------------------------
STATUS	equ	0xfd8
WREG	equ	0xfe8
FSR0L	equ	0xfe9
FSR0H	equ	0xfea
FSR1L	equ	0xfe1
FSR2L	equ	0xfd9
INDF0	equ	0xfef
POSTDEC1	equ	0xfe5
PREINC1	equ	0xfe4
PLUSW2	equ	0xfdb
PRODL	equ	0xff3
PRODH	equ	0xff4


; Internal registers
.registers	udata_ovr	0x0000
r0x00	res	1
r0x01	res	1
r0x02	res	1
r0x03	res	1
r0x04	res	1
r0x05	res	1
r0x06	res	1
r0x07	res	1
r0x08	res	1
r0x09	res	1
r0x0a	res	1
r0x0b	res	1
r0x0c	res	1
r0x0d	res	1
r0x0e	res	1
r0x0f	res	1

udata_protocol_0	udata
_protocol_packets	res	3

udata_protocol_1	udata
_protocol_frame	res	3

udata_protocol_2	udata
_state	res	1

udata_protocol_3	udata
_add_to_protocol_decoder_buf_1_1	res	2

udata_protocol_4	udata
_src	res	1

udata_protocol_5	udata
_dst	res	1

udata_protocol_6	udata
_decode_frame_hex_buf_1_1	res	5

udata_protocol_7	udata
_decode_frame_int_buf_1_1	res	4

udata_protocol_8	udata
_decode_frame_protocol_packet_s_1_1	res	10

udata_protocol_9	udata
_decode_frame_crc_1_1	res	5

udata_protocol_10	udata
_encode_frame_hex_buf_1_1	res	5

udata_protocol_11	udata
_encode_frame_int_buf_1_1	res	4

udata_protocol_12	udata
_encode_frame_protocol_packet_s_1_1	res	10

udata_protocol_13	udata
_encode_frame_crc_1_1	res	5

;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
; I code from now on!
; ; Starting pCode block
S_protocol__encode_frame	code
_encode_frame:
	.line	169; protocol.c	unsigned char encode_frame(unsigned char src, unsigned char dst) {
	MOVFF	FSR2L, POSTDEC1
	MOVFF	FSR1L, FSR2L
	MOVFF	r0x00, POSTDEC1
	MOVFF	r0x01, POSTDEC1
	MOVFF	r0x02, POSTDEC1
	MOVFF	r0x03, POSTDEC1
	MOVFF	r0x04, POSTDEC1
	MOVFF	r0x05, POSTDEC1
	MOVFF	r0x06, POSTDEC1
	MOVFF	r0x07, POSTDEC1
	MOVFF	r0x08, POSTDEC1
	MOVFF	r0x09, POSTDEC1
	MOVFF	r0x0a, POSTDEC1
	MOVFF	r0x0b, POSTDEC1
	MOVLW	0x02
	MOVFF	PLUSW2, r0x00
	MOVLW	0x03
	MOVFF	PLUSW2, r0x01
	.line	179; protocol.c	protocol_frame[0] = '\0';
	MOVFF	_protocol_frame, r0x02
	MOVFF	(_protocol_frame + 1), r0x03
	MOVFF	(_protocol_frame + 2), r0x04
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVFF	r0x02, FSR0L
	MOVFF	r0x03, PRODL
	MOVF	r0x04, W
	CALL	__gptrput1
	.line	180; protocol.c	strcpy(protocol_frame, ":");
	MOVFF	_protocol_frame, r0x02
	MOVFF	(_protocol_frame + 1), r0x03
	MOVFF	(_protocol_frame + 2), r0x04
	MOVLW	UPPER(__str_1)
	MOVWF	POSTDEC1
	MOVLW	HIGH(__str_1)
	MOVWF	POSTDEC1
	MOVLW	LOW(__str_1)
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	CALL	_strcpy
	MOVLW	0x06
	ADDWF	FSR1L, F
	.line	183; protocol.c	sprintf(hex_buf, "%02x", src);
	CLRF	r0x02
	MOVLW	HIGH(_encode_frame_hex_buf_1_1)
	MOVWF	r0x04
	MOVLW	LOW(_encode_frame_hex_buf_1_1)
	MOVWF	r0x03
	MOVLW	0x80
	MOVWF	r0x05
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	MOVLW	UPPER(__str_2)
	MOVWF	POSTDEC1
	MOVLW	HIGH(__str_2)
	MOVWF	POSTDEC1
	MOVLW	LOW(__str_2)
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	CALL	_sprintf
	MOVLW	0x08
	ADDWF	FSR1L, F
	.line	184; protocol.c	strcat(protocol_frame, hex_buf);
	MOVFF	_protocol_frame, r0x03
	MOVFF	(_protocol_frame + 1), r0x04
	MOVFF	(_protocol_frame + 2), r0x05
	MOVLW	HIGH(_encode_frame_hex_buf_1_1)
	MOVWF	r0x07
	MOVLW	LOW(_encode_frame_hex_buf_1_1)
	MOVWF	r0x06
	MOVLW	0x80
	MOVWF	r0x08
	MOVF	r0x08, W
	MOVWF	POSTDEC1
	MOVF	r0x07, W
	MOVWF	POSTDEC1
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	CALL	_strcat
	MOVLW	0x06
	ADDWF	FSR1L, F
	.line	185; protocol.c	sprintf(int_buf, "%d", src);
	MOVLW	HIGH(_encode_frame_int_buf_1_1)
	MOVWF	r0x04
	MOVLW	LOW(_encode_frame_int_buf_1_1)
	MOVWF	r0x03
	MOVLW	0x80
	MOVWF	r0x05
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	MOVLW	UPPER(__str_0)
	MOVWF	POSTDEC1
	MOVLW	HIGH(__str_0)
	MOVWF	POSTDEC1
	MOVLW	LOW(__str_0)
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	CALL	_sprintf
	MOVLW	0x08
	ADDWF	FSR1L, F
	.line	186; protocol.c	crc_int = crc16(int_buf, strlen(int_buf), 0);
	MOVLW	HIGH(_encode_frame_int_buf_1_1)
	MOVWF	r0x02
	MOVLW	LOW(_encode_frame_int_buf_1_1)
	MOVWF	r0x00
	MOVLW	0x80
	MOVWF	r0x03
	MOVLW	HIGH(_encode_frame_int_buf_1_1)
	MOVWF	r0x05
	MOVLW	LOW(_encode_frame_int_buf_1_1)
	MOVWF	r0x04
	MOVLW	0x80
	MOVWF	r0x06
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	CALL	_strlen
	MOVWF	r0x04
	MOVFF	PRODL, r0x05
	MOVLW	0x03
	ADDWF	FSR1L, F
	CLRF	WREG
	BTFSC	r0x05, 7
	MOVLW	0xff
	MOVWF	r0x06
	MOVWF	r0x07
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVF	r0x07, W
	MOVWF	POSTDEC1
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	CALL	_crc16
	MOVWF	r0x00
	MOVFF	PRODL, r0x02
	MOVLW	0x09
	ADDWF	FSR1L, F
	.line	189; protocol.c	sprintf(hex_buf, "%02x", dst);
	CLRF	r0x03
	MOVLW	HIGH(_encode_frame_hex_buf_1_1)
	MOVWF	r0x05
	MOVLW	LOW(_encode_frame_hex_buf_1_1)
	MOVWF	r0x04
	MOVLW	0x80
	MOVWF	r0x06
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	MOVLW	UPPER(__str_2)
	MOVWF	POSTDEC1
	MOVLW	HIGH(__str_2)
	MOVWF	POSTDEC1
	MOVLW	LOW(__str_2)
	MOVWF	POSTDEC1
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	CALL	_sprintf
	MOVLW	0x08
	ADDWF	FSR1L, F
	.line	190; protocol.c	strcat(protocol_frame, hex_buf);
	MOVFF	_protocol_frame, r0x04
	MOVFF	(_protocol_frame + 1), r0x05
	MOVFF	(_protocol_frame + 2), r0x06
	MOVLW	HIGH(_encode_frame_hex_buf_1_1)
	MOVWF	r0x08
	MOVLW	LOW(_encode_frame_hex_buf_1_1)
	MOVWF	r0x07
	MOVLW	0x80
	MOVWF	r0x09
	MOVF	r0x09, W
	MOVWF	POSTDEC1
	MOVF	r0x08, W
	MOVWF	POSTDEC1
	MOVF	r0x07, W
	MOVWF	POSTDEC1
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	CALL	_strcat
	MOVLW	0x06
	ADDWF	FSR1L, F
	.line	191; protocol.c	sprintf(int_buf, "%d", dst);
	MOVLW	HIGH(_encode_frame_int_buf_1_1)
	MOVWF	r0x05
	MOVLW	LOW(_encode_frame_int_buf_1_1)
	MOVWF	r0x04
	MOVLW	0x80
	MOVWF	r0x06
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	MOVLW	UPPER(__str_0)
	MOVWF	POSTDEC1
	MOVLW	HIGH(__str_0)
	MOVWF	POSTDEC1
	MOVLW	LOW(__str_0)
	MOVWF	POSTDEC1
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	CALL	_sprintf
	MOVLW	0x08
	ADDWF	FSR1L, F
	.line	192; protocol.c	crc_int = crc16(int_buf, strlen(int_buf), crc_int);
	MOVLW	HIGH(_encode_frame_int_buf_1_1)
	MOVWF	r0x03
	MOVLW	LOW(_encode_frame_int_buf_1_1)
	MOVWF	r0x01
	MOVLW	0x80
	MOVWF	r0x04
	MOVLW	HIGH(_encode_frame_int_buf_1_1)
	MOVWF	r0x06
	MOVLW	LOW(_encode_frame_int_buf_1_1)
	MOVWF	r0x05
	MOVLW	0x80
	MOVWF	r0x07
	MOVF	r0x07, W
	MOVWF	POSTDEC1
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	CALL	_strlen
	MOVWF	r0x05
	MOVFF	PRODL, r0x06
	MOVLW	0x03
	ADDWF	FSR1L, F
	CLRF	WREG
	BTFSC	r0x06, 7
	MOVLW	0xff
	MOVWF	r0x07
	MOVWF	r0x08
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	MOVF	r0x08, W
	MOVWF	POSTDEC1
	MOVF	r0x07, W
	MOVWF	POSTDEC1
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	CALL	_crc16
	MOVWF	r0x00
	MOVFF	PRODL, r0x02
	MOVLW	0x09
	ADDWF	FSR1L, F
	.line	195; protocol.c	for (i = 0; i < protocol_packets->num; i++) {
	CLRF	r0x01
	CLRF	r0x03
	CLRF	r0x04
_00244_DS_:
	MOVFF	_protocol_packets, r0x05
	MOVFF	(_protocol_packets + 1), r0x06
	MOVFF	(_protocol_packets + 2), r0x07
	MOVLW	0x12
	ADDWF	r0x05, F
	MOVLW	0x00
	ADDWFC	r0x06, F
	MOVLW	0x00
	ADDWFC	r0x07, F
	MOVFF	r0x05, FSR0L
	MOVFF	r0x06, PRODL
	MOVF	r0x07, W
	CALL	__gptrget1
	MOVWF	r0x05
	MOVF	r0x05, W
	SUBWF	r0x01, W
	BTFSC	STATUS, 0
	BRA	_00247_DS_
	.line	197; protocol.c	sprintf(hex_buf, "%02x", protocol_packets->packet[i].cmd);
	MOVFF	_protocol_packets, r0x05
	MOVFF	(_protocol_packets + 1), r0x06
	MOVFF	(_protocol_packets + 2), r0x07
	MOVF	r0x03, W
	ADDWF	r0x05, F
	CLRF	WREG
	ADDWFC	r0x06, F
	CLRF	WREG
	ADDWFC	r0x07, F
	MOVFF	r0x05, FSR0L
	MOVFF	r0x06, PRODL
	MOVF	r0x07, W
	CALL	__gptrget1
	MOVWF	r0x05
	CLRF	r0x06
	MOVLW	HIGH(_encode_frame_hex_buf_1_1)
	MOVWF	r0x08
	MOVLW	LOW(_encode_frame_hex_buf_1_1)
	MOVWF	r0x07
	MOVLW	0x80
	MOVWF	r0x09
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVLW	UPPER(__str_2)
	MOVWF	POSTDEC1
	MOVLW	HIGH(__str_2)
	MOVWF	POSTDEC1
	MOVLW	LOW(__str_2)
	MOVWF	POSTDEC1
	MOVF	r0x09, W
	MOVWF	POSTDEC1
	MOVF	r0x08, W
	MOVWF	POSTDEC1
	MOVF	r0x07, W
	MOVWF	POSTDEC1
	CALL	_sprintf
	MOVLW	0x08
	ADDWF	FSR1L, F
	.line	198; protocol.c	strcat(protocol_frame, hex_buf);
	MOVFF	_protocol_frame, r0x05
	MOVFF	(_protocol_frame + 1), r0x06
	MOVFF	(_protocol_frame + 2), r0x07
	MOVLW	HIGH(_encode_frame_hex_buf_1_1)
	MOVWF	r0x09
	MOVLW	LOW(_encode_frame_hex_buf_1_1)
	MOVWF	r0x08
	MOVLW	0x80
	MOVWF	r0x0a
	MOVF	r0x0a, W
	MOVWF	POSTDEC1
	MOVF	r0x09, W
	MOVWF	POSTDEC1
	MOVF	r0x08, W
	MOVWF	POSTDEC1
	MOVF	r0x07, W
	MOVWF	POSTDEC1
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	CALL	_strcat
	MOVLW	0x06
	ADDWF	FSR1L, F
	.line	201; protocol.c	for (j = 0; j < PARAMS_LENGTH; j++) {
	CLRF	r0x05
_00240_DS_:
	MOVLW	0x08
	SUBWF	r0x05, W
	BTFSC	STATUS, 0
	BRA	_00246_DS_
	.line	202; protocol.c	sprintf(hex_buf, "%02x", protocol_packets->packet[i].params[j]);
	MOVFF	_protocol_packets, r0x06
	MOVFF	(_protocol_packets + 1), r0x07
	MOVFF	(_protocol_packets + 2), r0x08
	MOVF	r0x04, W
	ADDWF	r0x06, F
	CLRF	WREG
	ADDWFC	r0x07, F
	CLRF	WREG
	ADDWFC	r0x08, F
	INCF	r0x06, F
	BTFSC	STATUS, 0
	INCF	r0x07, F
	BTFSC	STATUS, 0
	INCF	r0x08, F
	MOVF	r0x05, W
	ADDWF	r0x06, F
	CLRF	WREG
	ADDWFC	r0x07, F
	CLRF	WREG
	ADDWFC	r0x08, F
	MOVFF	r0x06, FSR0L
	MOVFF	r0x07, PRODL
	MOVF	r0x08, W
	CALL	__gptrget1
	MOVWF	r0x06
	CLRF	r0x07
	BTFSC	r0x06, 7
	SETF	r0x07
	MOVLW	HIGH(_encode_frame_hex_buf_1_1)
	MOVWF	r0x09
	MOVLW	LOW(_encode_frame_hex_buf_1_1)
	MOVWF	r0x08
	MOVLW	0x80
	MOVWF	r0x0a
	MOVF	r0x07, W
	MOVWF	POSTDEC1
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVLW	UPPER(__str_2)
	MOVWF	POSTDEC1
	MOVLW	HIGH(__str_2)
	MOVWF	POSTDEC1
	MOVLW	LOW(__str_2)
	MOVWF	POSTDEC1
	MOVF	r0x0a, W
	MOVWF	POSTDEC1
	MOVF	r0x09, W
	MOVWF	POSTDEC1
	MOVF	r0x08, W
	MOVWF	POSTDEC1
	CALL	_sprintf
	MOVLW	0x08
	ADDWF	FSR1L, F
	.line	203; protocol.c	strcat(protocol_frame, hex_buf);
	MOVFF	_protocol_frame, r0x06
	MOVFF	(_protocol_frame + 1), r0x07
	MOVFF	(_protocol_frame + 2), r0x08
	MOVLW	HIGH(_encode_frame_hex_buf_1_1)
	MOVWF	r0x0a
	MOVLW	LOW(_encode_frame_hex_buf_1_1)
	MOVWF	r0x09
	MOVLW	0x80
	MOVWF	r0x0b
	MOVF	r0x0b, W
	MOVWF	POSTDEC1
	MOVF	r0x0a, W
	MOVWF	POSTDEC1
	MOVF	r0x09, W
	MOVWF	POSTDEC1
	MOVF	r0x08, W
	MOVWF	POSTDEC1
	MOVF	r0x07, W
	MOVWF	POSTDEC1
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	CALL	_strcat
	MOVLW	0x06
	ADDWF	FSR1L, F
	.line	201; protocol.c	for (j = 0; j < PARAMS_LENGTH; j++) {
	INCF	r0x05, F
	BRA	_00240_DS_
_00246_DS_:
	.line	195; protocol.c	for (i = 0; i < protocol_packets->num; i++) {
	MOVLW	0x09
	ADDWF	r0x03, F
	MOVLW	0x09
	ADDWF	r0x04, F
	INCF	r0x01, F
	BRA	_00244_DS_
_00247_DS_:
	.line	208; protocol.c	for (i = 0; i < protocol_packets->num; i++) {
	CLRF	r0x01
	CLRF	r0x03
_00248_DS_:
	MOVFF	_protocol_packets, r0x04
	MOVFF	(_protocol_packets + 1), r0x05
	MOVFF	(_protocol_packets + 2), r0x06
	MOVLW	0x12
	ADDWF	r0x04, F
	MOVLW	0x00
	ADDWFC	r0x05, F
	MOVLW	0x00
	ADDWFC	r0x06, F
	MOVFF	r0x04, FSR0L
	MOVFF	r0x05, PRODL
	MOVF	r0x06, W
	CALL	__gptrget1
	MOVWF	r0x04
	MOVF	r0x04, W
	SUBWF	r0x01, W
	BTFSC	STATUS, 0
	BRA	_00251_DS_
	.line	209; protocol.c	memcpy(protocol_packet_s, protocol_packets->packet[i].params, PACKET_LENGTH);
	MOVLW	HIGH(_encode_frame_protocol_packet_s_1_1)
	MOVWF	r0x05
	MOVLW	LOW(_encode_frame_protocol_packet_s_1_1)
	MOVWF	r0x04
	MOVLW	0x80
	MOVWF	r0x06
	MOVFF	_protocol_packets, r0x07
	MOVFF	(_protocol_packets + 1), r0x08
	MOVFF	(_protocol_packets + 2), r0x09
	MOVF	r0x03, W
	ADDWF	r0x07, F
	CLRF	WREG
	ADDWFC	r0x08, F
	CLRF	WREG
	ADDWFC	r0x09, F
	INCF	r0x07, F
	BTFSC	STATUS, 0
	INCF	r0x08, F
	BTFSC	STATUS, 0
	INCF	r0x09, F
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x09
	MOVWF	POSTDEC1
	MOVF	r0x09, W
	MOVWF	POSTDEC1
	MOVF	r0x08, W
	MOVWF	POSTDEC1
	MOVF	r0x07, W
	MOVWF	POSTDEC1
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	CALL	_memcpy
	MOVLW	0x08
	ADDWF	FSR1L, F
	BANKSEL	(_encode_frame_protocol_packet_s_1_1 + 9)
	.line	210; protocol.c	protocol_packet_s[PACKET_LENGTH] = '\0';
	CLRF	(_encode_frame_protocol_packet_s_1_1 + 9), B
	.line	211; protocol.c	crc_int = crc16(protocol_packet_s, strlen(protocol_packet_s), crc_int);
	MOVLW	HIGH(_encode_frame_protocol_packet_s_1_1)
	MOVWF	r0x05
	MOVLW	LOW(_encode_frame_protocol_packet_s_1_1)
	MOVWF	r0x04
	MOVLW	0x80
	MOVWF	r0x06
	MOVLW	HIGH(_encode_frame_protocol_packet_s_1_1)
	MOVWF	r0x08
	MOVLW	LOW(_encode_frame_protocol_packet_s_1_1)
	MOVWF	r0x07
	MOVLW	0x80
	MOVWF	r0x09
	MOVF	r0x09, W
	MOVWF	POSTDEC1
	MOVF	r0x08, W
	MOVWF	POSTDEC1
	MOVF	r0x07, W
	MOVWF	POSTDEC1
	CALL	_strlen
	MOVWF	r0x07
	MOVFF	PRODL, r0x08
	MOVLW	0x03
	ADDWF	FSR1L, F
	CLRF	WREG
	BTFSC	r0x08, 7
	MOVLW	0xff
	MOVWF	r0x09
	MOVWF	r0x0a
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	MOVF	r0x0a, W
	MOVWF	POSTDEC1
	MOVF	r0x09, W
	MOVWF	POSTDEC1
	MOVF	r0x08, W
	MOVWF	POSTDEC1
	MOVF	r0x07, W
	MOVWF	POSTDEC1
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	CALL	_crc16
	MOVWF	r0x00
	MOVFF	PRODL, r0x02
	MOVLW	0x09
	ADDWF	FSR1L, F
	.line	208; protocol.c	for (i = 0; i < protocol_packets->num; i++) {
	MOVLW	0x09
	ADDWF	r0x03, F
	INCF	r0x01, F
	BRA	_00248_DS_
_00251_DS_:
	.line	213; protocol.c	sprintf(crc, "%02x%02x", (crc_int >> 8), (crc_int & 0xff));
	MOVF	r0x00, W
	MOVWF	r0x01
	CLRF	r0x03
	MOVF	r0x02, W
	MOVWF	r0x00
	CLRF	r0x02
	MOVLW	HIGH(_encode_frame_crc_1_1)
	MOVWF	r0x05
	MOVLW	LOW(_encode_frame_crc_1_1)
	MOVWF	r0x04
	MOVLW	0x80
	MOVWF	r0x06
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	MOVLW	UPPER(__str_3)
	MOVWF	POSTDEC1
	MOVLW	HIGH(__str_3)
	MOVWF	POSTDEC1
	MOVLW	LOW(__str_3)
	MOVWF	POSTDEC1
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	CALL	_sprintf
	MOVLW	0x0a
	ADDWF	FSR1L, F
	.line	214; protocol.c	strcat(protocol_frame, crc);
	MOVFF	_protocol_frame, r0x00
	MOVFF	(_protocol_frame + 1), r0x01
	MOVFF	(_protocol_frame + 2), r0x02
	MOVLW	HIGH(_encode_frame_crc_1_1)
	MOVWF	r0x04
	MOVLW	LOW(_encode_frame_crc_1_1)
	MOVWF	r0x03
	MOVLW	0x80
	MOVWF	r0x05
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	CALL	_strcat
	MOVLW	0x06
	ADDWF	FSR1L, F
	.line	217; protocol.c	strcat(protocol_frame, "\r");
	MOVFF	_protocol_frame, r0x00
	MOVFF	(_protocol_frame + 1), r0x01
	MOVFF	(_protocol_frame + 2), r0x02
	MOVLW	UPPER(__str_4)
	MOVWF	POSTDEC1
	MOVLW	HIGH(__str_4)
	MOVWF	POSTDEC1
	MOVLW	LOW(__str_4)
	MOVWF	POSTDEC1
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	CALL	_strcat
	MOVLW	0x06
	ADDWF	FSR1L, F
	.line	218; protocol.c	strcat(protocol_frame, "\n");
	MOVFF	_protocol_frame, r0x00
	MOVFF	(_protocol_frame + 1), r0x01
	MOVFF	(_protocol_frame + 2), r0x02
	MOVLW	UPPER(__str_5)
	MOVWF	POSTDEC1
	MOVLW	HIGH(__str_5)
	MOVWF	POSTDEC1
	MOVLW	LOW(__str_5)
	MOVWF	POSTDEC1
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	CALL	_strcat
	MOVLW	0x06
	ADDWF	FSR1L, F
	.line	219; protocol.c	return 1;
	MOVLW	0x01
	MOVFF	PREINC1, r0x0b
	MOVFF	PREINC1, r0x0a
	MOVFF	PREINC1, r0x09
	MOVFF	PREINC1, r0x08
	MOVFF	PREINC1, r0x07
	MOVFF	PREINC1, r0x06
	MOVFF	PREINC1, r0x05
	MOVFF	PREINC1, r0x04
	MOVFF	PREINC1, r0x03
	MOVFF	PREINC1, r0x02
	MOVFF	PREINC1, r0x01
	MOVFF	PREINC1, r0x00
	MOVFF	PREINC1, FSR2L
	RETURN	

; ; Starting pCode block
S_protocol__decode_frame	code
_decode_frame:
	.line	96; protocol.c	unsigned char decode_frame() {
	MOVFF	FSR2L, POSTDEC1
	MOVFF	FSR1L, FSR2L
	MOVFF	r0x00, POSTDEC1
	MOVFF	r0x01, POSTDEC1
	MOVFF	r0x02, POSTDEC1
	MOVFF	r0x03, POSTDEC1
	MOVFF	r0x04, POSTDEC1
	MOVFF	r0x05, POSTDEC1
	MOVFF	r0x06, POSTDEC1
	MOVFF	r0x07, POSTDEC1
	MOVFF	r0x08, POSTDEC1
	MOVFF	r0x09, POSTDEC1
	MOVFF	r0x0a, POSTDEC1
	MOVFF	r0x0b, POSTDEC1
	MOVFF	r0x0c, POSTDEC1
	MOVFF	r0x0d, POSTDEC1
	MOVFF	r0x0e, POSTDEC1
	MOVFF	r0x0f, POSTDEC1
	.line	106; protocol.c	for (i = 0; i < (SRC_SIZE / 2); i++) {
	CLRF	r0x00
	CLRF	r0x01
	CLRF	r0x02
_00185_DS_:
	MOVLW	0x01
	SUBWF	r0x00, W
	BTFSC	STATUS, 0
	BRA	_00188_DS_
	.line	107; protocol.c	hex_buf[0] = protocol_frame[START_SIZE + (i * 2)];
	MOVF	r0x01, W
	ADDLW	0x01
	MOVWF	r0x03
	MOVLW	0x00
	ADDWFC	r0x02, W
	MOVWF	r0x04
	CLRF	r0x05
	BTFSC	r0x04, 7
	SETF	r0x05
	BANKSEL	_protocol_frame
	MOVF	_protocol_frame, W, B
	ADDWF	r0x03, F
	BANKSEL	(_protocol_frame + 1)
	MOVF	(_protocol_frame + 1), W, B
	ADDWFC	r0x04, F
	BANKSEL	(_protocol_frame + 2)
	MOVF	(_protocol_frame + 2), W, B
	ADDWFC	r0x05, F
	MOVFF	r0x03, FSR0L
	MOVFF	r0x04, PRODL
	MOVF	r0x05, W
	CALL	__gptrget1
	MOVWF	r0x03
	MOVF	r0x03, W
	BANKSEL	_decode_frame_hex_buf_1_1
	MOVWF	_decode_frame_hex_buf_1_1, B
	.line	108; protocol.c	hex_buf[1] = protocol_frame[START_SIZE + (i * 2) + 1];
	MOVF	r0x01, W
	ADDLW	0x02
	MOVWF	r0x03
	MOVLW	0x00
	ADDWFC	r0x02, W
	MOVWF	r0x04
	MOVF	r0x03, W
	BANKSEL	_protocol_frame
	ADDWF	_protocol_frame, W, B
	MOVWF	r0x05
	MOVF	r0x04, W
	BANKSEL	(_protocol_frame + 1)
	ADDWFC	(_protocol_frame + 1), W, B
	MOVWF	r0x06
	CLRF	WREG
	BTFSC	r0x04, 7
	SETF	WREG
	BANKSEL	(_protocol_frame + 2)
	ADDWFC	(_protocol_frame + 2), W, B
	MOVWF	r0x07
	MOVFF	r0x05, FSR0L
	MOVFF	r0x06, PRODL
	MOVF	r0x07, W
	CALL	__gptrget1
	MOVWF	r0x05
	MOVF	r0x05, W
	BANKSEL	(_decode_frame_hex_buf_1_1 + 1)
	MOVWF	(_decode_frame_hex_buf_1_1 + 1), B
	BANKSEL	(_decode_frame_hex_buf_1_1 + 2)
	.line	109; protocol.c	hex_buf[2] = '\0';
	CLRF	(_decode_frame_hex_buf_1_1 + 2), B
	.line	106; protocol.c	for (i = 0; i < (SRC_SIZE / 2); i++) {
	MOVFF	r0x03, r0x01
	MOVFF	r0x04, r0x02
	INCF	r0x00, F
	BRA	_00185_DS_
_00188_DS_:
	.line	111; protocol.c	src = strtol(hex_buf, NULL, 16);
	MOVLW	HIGH(_decode_frame_hex_buf_1_1)
	MOVWF	r0x01
	MOVLW	LOW(_decode_frame_hex_buf_1_1)
	MOVWF	r0x00
	MOVLW	0x80
	MOVWF	r0x02
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x10
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	CALL	_strtol
	MOVWF	r0x00
	MOVFF	PRODL, r0x01
	MOVFF	PRODH, r0x02
	MOVFF	FSR0L, r0x03
	MOVLW	0x08
	ADDWF	FSR1L, F
	MOVF	r0x00, W
	BANKSEL	_src
	MOVWF	_src, B
	.line	112; protocol.c	sprintf(int_buf, "%d", src);
	MOVFF	_src, r0x00
	CLRF	r0x01
	MOVLW	HIGH(_decode_frame_int_buf_1_1)
	MOVWF	r0x03
	MOVLW	LOW(_decode_frame_int_buf_1_1)
	MOVWF	r0x02
	MOVLW	0x80
	MOVWF	r0x04
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	MOVLW	UPPER(__str_0)
	MOVWF	POSTDEC1
	MOVLW	HIGH(__str_0)
	MOVWF	POSTDEC1
	MOVLW	LOW(__str_0)
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	CALL	_sprintf
	MOVLW	0x08
	ADDWF	FSR1L, F
	.line	113; protocol.c	crc_int = crc16(int_buf, strlen(int_buf), 0);
	MOVLW	HIGH(_decode_frame_int_buf_1_1)
	MOVWF	r0x01
	MOVLW	LOW(_decode_frame_int_buf_1_1)
	MOVWF	r0x00
	MOVLW	0x80
	MOVWF	r0x02
	MOVLW	HIGH(_decode_frame_int_buf_1_1)
	MOVWF	r0x04
	MOVLW	LOW(_decode_frame_int_buf_1_1)
	MOVWF	r0x03
	MOVLW	0x80
	MOVWF	r0x05
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	CALL	_strlen
	MOVWF	r0x03
	MOVFF	PRODL, r0x04
	MOVLW	0x03
	ADDWF	FSR1L, F
	CLRF	WREG
	BTFSC	r0x04, 7
	MOVLW	0xff
	MOVWF	r0x05
	MOVWF	r0x06
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	CALL	_crc16
	MOVWF	r0x00
	MOVFF	PRODL, r0x01
	MOVLW	0x09
	ADDWF	FSR1L, F
	.line	116; protocol.c	for (i = 0; i < (DST_SIZE / 2); i++) {
	CLRF	r0x02
	CLRF	r0x03
	CLRF	r0x04
_00189_DS_:
	MOVLW	0x01
	SUBWF	r0x02, W
	BTFSC	STATUS, 0
	BRA	_00192_DS_
	.line	117; protocol.c	hex_buf[0] = protocol_frame[START_SIZE + SRC_SIZE + (i * 2)];
	MOVF	r0x03, W
	ADDLW	0x03
	MOVWF	r0x05
	MOVLW	0x00
	ADDWFC	r0x04, W
	MOVWF	r0x06
	CLRF	r0x07
	BTFSC	r0x06, 7
	SETF	r0x07
	BANKSEL	_protocol_frame
	MOVF	_protocol_frame, W, B
	ADDWF	r0x05, F
	BANKSEL	(_protocol_frame + 1)
	MOVF	(_protocol_frame + 1), W, B
	ADDWFC	r0x06, F
	BANKSEL	(_protocol_frame + 2)
	MOVF	(_protocol_frame + 2), W, B
	ADDWFC	r0x07, F
	MOVFF	r0x05, FSR0L
	MOVFF	r0x06, PRODL
	MOVF	r0x07, W
	CALL	__gptrget1
	MOVWF	r0x05
	MOVF	r0x05, W
	BANKSEL	_decode_frame_hex_buf_1_1
	MOVWF	_decode_frame_hex_buf_1_1, B
	.line	118; protocol.c	hex_buf[1] = protocol_frame[START_SIZE + SRC_SIZE + (i * 2) + 1];
	MOVF	r0x03, W
	ADDLW	0x04
	MOVWF	r0x05
	MOVLW	0x00
	ADDWFC	r0x04, W
	MOVWF	r0x06
	CLRF	r0x07
	BTFSC	r0x06, 7
	SETF	r0x07
	BANKSEL	_protocol_frame
	MOVF	_protocol_frame, W, B
	ADDWF	r0x05, F
	BANKSEL	(_protocol_frame + 1)
	MOVF	(_protocol_frame + 1), W, B
	ADDWFC	r0x06, F
	BANKSEL	(_protocol_frame + 2)
	MOVF	(_protocol_frame + 2), W, B
	ADDWFC	r0x07, F
	MOVFF	r0x05, FSR0L
	MOVFF	r0x06, PRODL
	MOVF	r0x07, W
	CALL	__gptrget1
	MOVWF	r0x05
	MOVF	r0x05, W
	BANKSEL	(_decode_frame_hex_buf_1_1 + 1)
	MOVWF	(_decode_frame_hex_buf_1_1 + 1), B
	BANKSEL	(_decode_frame_hex_buf_1_1 + 2)
	.line	119; protocol.c	hex_buf[2] = '\0';
	CLRF	(_decode_frame_hex_buf_1_1 + 2), B
	.line	116; protocol.c	for (i = 0; i < (DST_SIZE / 2); i++) {
	MOVLW	0x02
	ADDWF	r0x03, F
	BTFSC	STATUS, 0
	INCF	r0x04, F
	INCF	r0x02, F
	BRA	_00189_DS_
_00192_DS_:
	.line	121; protocol.c	dst = strtol(hex_buf, NULL, 16);
	MOVLW	HIGH(_decode_frame_hex_buf_1_1)
	MOVWF	r0x03
	MOVLW	LOW(_decode_frame_hex_buf_1_1)
	MOVWF	r0x02
	MOVLW	0x80
	MOVWF	r0x04
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x10
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	CALL	_strtol
	MOVWF	r0x02
	MOVFF	PRODL, r0x03
	MOVFF	PRODH, r0x04
	MOVFF	FSR0L, r0x05
	MOVLW	0x08
	ADDWF	FSR1L, F
	MOVF	r0x02, W
	BANKSEL	_dst
	MOVWF	_dst, B
	.line	122; protocol.c	sprintf(int_buf, "%d", dst);
	MOVFF	_dst, r0x02
	CLRF	r0x03
	MOVLW	HIGH(_decode_frame_int_buf_1_1)
	MOVWF	r0x05
	MOVLW	LOW(_decode_frame_int_buf_1_1)
	MOVWF	r0x04
	MOVLW	0x80
	MOVWF	r0x06
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVLW	UPPER(__str_0)
	MOVWF	POSTDEC1
	MOVLW	HIGH(__str_0)
	MOVWF	POSTDEC1
	MOVLW	LOW(__str_0)
	MOVWF	POSTDEC1
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	CALL	_sprintf
	MOVLW	0x08
	ADDWF	FSR1L, F
	.line	123; protocol.c	crc_int = crc16(int_buf, strlen(int_buf), crc_int);
	MOVLW	HIGH(_decode_frame_int_buf_1_1)
	MOVWF	r0x03
	MOVLW	LOW(_decode_frame_int_buf_1_1)
	MOVWF	r0x02
	MOVLW	0x80
	MOVWF	r0x04
	MOVLW	HIGH(_decode_frame_int_buf_1_1)
	MOVWF	r0x06
	MOVLW	LOW(_decode_frame_int_buf_1_1)
	MOVWF	r0x05
	MOVLW	0x80
	MOVWF	r0x07
	MOVF	r0x07, W
	MOVWF	POSTDEC1
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	CALL	_strlen
	MOVWF	r0x05
	MOVFF	PRODL, r0x06
	MOVLW	0x03
	ADDWF	FSR1L, F
	CLRF	WREG
	BTFSC	r0x06, 7
	MOVLW	0xff
	MOVWF	r0x07
	MOVWF	r0x08
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	MOVF	r0x08, W
	MOVWF	POSTDEC1
	MOVF	r0x07, W
	MOVWF	POSTDEC1
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	CALL	_crc16
	MOVWF	r0x00
	MOVFF	PRODL, r0x01
	MOVLW	0x09
	ADDWF	FSR1L, F
	.line	126; protocol.c	len = strlen(protocol_frame);
	MOVFF	_protocol_frame, r0x02
	MOVFF	(_protocol_frame + 1), r0x03
	MOVFF	(_protocol_frame + 2), r0x04
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	CALL	_strlen
	MOVWF	r0x02
	MOVFF	PRODL, r0x03
	MOVLW	0x03
	ADDWF	FSR1L, F
	.line	127; protocol.c	for (i = 0; i < ((len - (START_SIZE + SRC_SIZE + DST_SIZE + CRC_SIZE + STOP_SIZE)) / 2); i++) {
	CLRF	r0x03
	CLRF	r0x04
	CLRF	r0x05
_00193_DS_:
	MOVFF	r0x02, r0x06
	CLRF	r0x07
	MOVF	r0x06, W
	ADDLW	0xf5
	MOVWF	r0x08
	MOVLW	0xff
	ADDWFC	r0x07, W
	MOVWF	r0x09
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x02
	MOVWF	POSTDEC1
	MOVF	r0x09, W
	MOVWF	POSTDEC1
	MOVF	r0x08, W
	MOVWF	POSTDEC1
	CALL	__divsint
	MOVWF	r0x08
	MOVFF	PRODL, r0x09
	MOVLW	0x04
	ADDWF	FSR1L, F
	MOVFF	r0x03, r0x0a
	CLRF	r0x0b
	MOVF	r0x0b, W
	ADDLW	0x80
	MOVWF	PRODL
	MOVF	r0x09, W
	ADDLW	0x80
	SUBWF	PRODL, W
	BNZ	_00226_DS_
	MOVF	r0x08, W
	SUBWF	r0x0a, W
_00226_DS_:
	BTFSC	STATUS, 0
	BRA	_00196_DS_
	.line	128; protocol.c	hex_buf[0] = protocol_frame[START_SIZE + SRC_SIZE + DST_SIZE + (i * 2)];
	MOVF	r0x04, W
	ADDLW	0x05
	MOVWF	r0x08
	MOVLW	0x00
	ADDWFC	r0x05, W
	MOVWF	r0x09
	CLRF	r0x0a
	BTFSC	r0x09, 7
	SETF	r0x0a
	BANKSEL	_protocol_frame
	MOVF	_protocol_frame, W, B
	ADDWF	r0x08, F
	BANKSEL	(_protocol_frame + 1)
	MOVF	(_protocol_frame + 1), W, B
	ADDWFC	r0x09, F
	BANKSEL	(_protocol_frame + 2)
	MOVF	(_protocol_frame + 2), W, B
	ADDWFC	r0x0a, F
	MOVFF	r0x08, FSR0L
	MOVFF	r0x09, PRODL
	MOVF	r0x0a, W
	CALL	__gptrget1
	MOVWF	r0x08
	MOVF	r0x08, W
	BANKSEL	_decode_frame_hex_buf_1_1
	MOVWF	_decode_frame_hex_buf_1_1, B
	.line	129; protocol.c	hex_buf[1] = protocol_frame[START_SIZE + SRC_SIZE + DST_SIZE + (i * 2) + 1];
	MOVF	r0x04, W
	ADDLW	0x06
	MOVWF	r0x08
	MOVLW	0x00
	ADDWFC	r0x05, W
	MOVWF	r0x09
	CLRF	r0x0a
	BTFSC	r0x09, 7
	SETF	r0x0a
	BANKSEL	_protocol_frame
	MOVF	_protocol_frame, W, B
	ADDWF	r0x08, F
	BANKSEL	(_protocol_frame + 1)
	MOVF	(_protocol_frame + 1), W, B
	ADDWFC	r0x09, F
	BANKSEL	(_protocol_frame + 2)
	MOVF	(_protocol_frame + 2), W, B
	ADDWFC	r0x0a, F
	MOVFF	r0x08, FSR0L
	MOVFF	r0x09, PRODL
	MOVF	r0x0a, W
	CALL	__gptrget1
	MOVWF	r0x08
	MOVF	r0x08, W
	BANKSEL	(_decode_frame_hex_buf_1_1 + 1)
	MOVWF	(_decode_frame_hex_buf_1_1 + 1), B
	BANKSEL	(_decode_frame_hex_buf_1_1 + 2)
	.line	130; protocol.c	hex_buf[2] = '\0';
	CLRF	(_decode_frame_hex_buf_1_1 + 2), B
	.line	133; protocol.c	if ((i % PACKET_LENGTH) == 0) {
	MOVLW	0x09
	MOVWF	POSTDEC1
	MOVFF	r0x03, POSTDEC1
	CALL	__moduchar
	MOVWF	r0x08
	MOVF	PREINC1, W
	MOVF	PREINC1, W
	MOVF	r0x08, W
	BTFSS	STATUS, 2
	BRA	_00180_DS_
	.line	134; protocol.c	protocol_packets->packet[i / PACKET_LENGTH].cmd = strtol(hex_buf, NULL, 16);
	MOVFF	_protocol_packets, r0x09
	MOVFF	(_protocol_packets + 1), r0x0a
	MOVFF	(_protocol_packets + 2), r0x0b
	MOVLW	0x09
	MOVWF	POSTDEC1
	MOVFF	r0x03, POSTDEC1
	CALL	__divuchar
	MOVWF	r0x0c
	MOVF	PREINC1, W
	MOVF	PREINC1, W
; ;multiply lit val:0x09 by variable r0x0c and store in r0x0c
; ;Unrolled 8 X 8 multiplication
; ;FIXME: the function does not support result==WREG
	MOVF	r0x0c, W
	MULLW	0x09
	MOVFF	PRODL, r0x0c
	MOVF	r0x0c, W
	ADDWF	r0x09, F
	CLRF	WREG
	ADDWFC	r0x0a, F
	CLRF	WREG
	ADDWFC	r0x0b, F
	MOVLW	HIGH(_decode_frame_hex_buf_1_1)
	MOVWF	r0x0d
	MOVLW	LOW(_decode_frame_hex_buf_1_1)
	MOVWF	r0x0c
	MOVLW	0x80
	MOVWF	r0x0e
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x10
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVF	r0x0e, W
	MOVWF	POSTDEC1
	MOVF	r0x0d, W
	MOVWF	POSTDEC1
	MOVF	r0x0c, W
	MOVWF	POSTDEC1
	CALL	_strtol
	MOVWF	r0x0c
	MOVFF	PRODL, r0x0d
	MOVFF	PRODH, r0x0e
	MOVFF	FSR0L, r0x0f
	MOVLW	0x08
	ADDWF	FSR1L, F
	MOVFF	r0x0c, POSTDEC1
	MOVFF	r0x09, FSR0L
	MOVFF	r0x0a, PRODL
	MOVF	r0x0b, W
	CALL	__gptrput1
	.line	135; protocol.c	protocol_packets->num++;
	MOVFF	_protocol_packets, r0x09
	MOVFF	(_protocol_packets + 1), r0x0a
	MOVFF	(_protocol_packets + 2), r0x0b
	MOVLW	0x12
	ADDWF	r0x09, F
	MOVLW	0x00
	ADDWFC	r0x0a, F
	MOVLW	0x00
	ADDWFC	r0x0b, F
	MOVFF	r0x09, FSR0L
	MOVFF	r0x0a, PRODL
	MOVF	r0x0b, W
	CALL	__gptrget1
	MOVWF	r0x0c
	INCF	r0x0c, F
	MOVFF	r0x0c, POSTDEC1
	MOVFF	r0x09, FSR0L
	MOVFF	r0x0a, PRODL
	MOVF	r0x0b, W
	CALL	__gptrput1
	BRA	_00195_DS_
_00180_DS_:
	.line	138; protocol.c	protocol_packets->packet[i / PACKET_LENGTH].params[(i % PACKET_LENGTH) - CMD_LENGTH] = strtol(hex_buf, NULL, 16);
	MOVFF	_protocol_packets, r0x09
	MOVFF	(_protocol_packets + 1), r0x0a
	MOVFF	(_protocol_packets + 2), r0x0b
	MOVLW	0x09
	MOVWF	POSTDEC1
	MOVFF	r0x03, POSTDEC1
	CALL	__divuchar
	MOVWF	r0x0c
	MOVF	PREINC1, W
	MOVF	PREINC1, W
; ;multiply lit val:0x09 by variable r0x0c and store in r0x0c
; ;Unrolled 8 X 8 multiplication
; ;FIXME: the function does not support result==WREG
	MOVF	r0x0c, W
	MULLW	0x09
	MOVFF	PRODL, r0x0c
	MOVF	r0x0c, W
	ADDWF	r0x09, F
	CLRF	WREG
	ADDWFC	r0x0a, F
	CLRF	WREG
	ADDWFC	r0x0b, F
	INCF	r0x09, F
	BTFSC	STATUS, 0
	INCF	r0x0a, F
	BTFSC	STATUS, 0
	INCF	r0x0b, F
	DECF	r0x08, F
	MOVF	r0x08, W
	ADDWF	r0x09, F
	CLRF	WREG
	ADDWFC	r0x0a, F
	CLRF	WREG
	ADDWFC	r0x0b, F
	MOVLW	HIGH(_decode_frame_hex_buf_1_1)
	MOVWF	r0x0c
	MOVLW	LOW(_decode_frame_hex_buf_1_1)
	MOVWF	r0x08
	MOVLW	0x80
	MOVWF	r0x0d
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x10
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVF	r0x0d, W
	MOVWF	POSTDEC1
	MOVF	r0x0c, W
	MOVWF	POSTDEC1
	MOVF	r0x08, W
	MOVWF	POSTDEC1
	CALL	_strtol
	MOVWF	r0x08
	MOVFF	PRODL, r0x0c
	MOVFF	PRODH, r0x0d
	MOVFF	FSR0L, r0x0e
	MOVLW	0x08
	ADDWF	FSR1L, F
	MOVFF	r0x08, POSTDEC1
	MOVFF	r0x09, FSR0L
	MOVFF	r0x0a, PRODL
	MOVF	r0x0b, W
	CALL	__gptrput1
_00195_DS_:
	.line	127; protocol.c	for (i = 0; i < ((len - (START_SIZE + SRC_SIZE + DST_SIZE + CRC_SIZE + STOP_SIZE)) / 2); i++) {
	MOVLW	0x02
	ADDWF	r0x04, F
	BTFSC	STATUS, 0
	INCF	r0x05, F
	INCF	r0x03, F
	BRA	_00193_DS_
_00196_DS_:
	.line	141; protocol.c	for (i = 0; i < protocol_packets->num; i++) {
	CLRF	r0x03
	CLRF	r0x04
_00197_DS_:
	MOVFF	_protocol_packets, r0x05
	MOVFF	(_protocol_packets + 1), r0x08
	MOVFF	(_protocol_packets + 2), r0x09
	MOVLW	0x12
	ADDWF	r0x05, F
	MOVLW	0x00
	ADDWFC	r0x08, F
	MOVLW	0x00
	ADDWFC	r0x09, F
	MOVFF	r0x05, FSR0L
	MOVFF	r0x08, PRODL
	MOVF	r0x09, W
	CALL	__gptrget1
	MOVWF	r0x05
	MOVF	r0x05, W
	SUBWF	r0x03, W
	BTFSC	STATUS, 0
	BRA	_00200_DS_
	.line	142; protocol.c	memcpy(protocol_packet_s, protocol_packets->packet[i].params, PACKET_LENGTH);
	MOVLW	HIGH(_decode_frame_protocol_packet_s_1_1)
	MOVWF	r0x08
	MOVLW	LOW(_decode_frame_protocol_packet_s_1_1)
	MOVWF	r0x05
	MOVLW	0x80
	MOVWF	r0x09
	MOVFF	_protocol_packets, r0x0a
	MOVFF	(_protocol_packets + 1), r0x0b
	MOVFF	(_protocol_packets + 2), r0x0c
	MOVF	r0x04, W
	ADDWF	r0x0a, F
	CLRF	WREG
	ADDWFC	r0x0b, F
	CLRF	WREG
	ADDWFC	r0x0c, F
	INCF	r0x0a, F
	BTFSC	STATUS, 0
	INCF	r0x0b, F
	BTFSC	STATUS, 0
	INCF	r0x0c, F
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x09
	MOVWF	POSTDEC1
	MOVF	r0x0c, W
	MOVWF	POSTDEC1
	MOVF	r0x0b, W
	MOVWF	POSTDEC1
	MOVF	r0x0a, W
	MOVWF	POSTDEC1
	MOVF	r0x09, W
	MOVWF	POSTDEC1
	MOVF	r0x08, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	CALL	_memcpy
	MOVLW	0x08
	ADDWF	FSR1L, F
	BANKSEL	(_decode_frame_protocol_packet_s_1_1 + 9)
	.line	143; protocol.c	protocol_packet_s[PACKET_LENGTH] = '\0';
	CLRF	(_decode_frame_protocol_packet_s_1_1 + 9), B
	.line	144; protocol.c	crc_int = crc16(protocol_packet_s, strlen(protocol_packet_s), crc_int);
	MOVLW	HIGH(_decode_frame_protocol_packet_s_1_1)
	MOVWF	r0x08
	MOVLW	LOW(_decode_frame_protocol_packet_s_1_1)
	MOVWF	r0x05
	MOVLW	0x80
	MOVWF	r0x09
	MOVLW	HIGH(_decode_frame_protocol_packet_s_1_1)
	MOVWF	r0x0b
	MOVLW	LOW(_decode_frame_protocol_packet_s_1_1)
	MOVWF	r0x0a
	MOVLW	0x80
	MOVWF	r0x0c
	MOVF	r0x0c, W
	MOVWF	POSTDEC1
	MOVF	r0x0b, W
	MOVWF	POSTDEC1
	MOVF	r0x0a, W
	MOVWF	POSTDEC1
	CALL	_strlen
	MOVWF	r0x0a
	MOVFF	PRODL, r0x0b
	MOVLW	0x03
	ADDWF	FSR1L, F
	CLRF	WREG
	BTFSC	r0x0b, 7
	MOVLW	0xff
	MOVWF	r0x0c
	MOVWF	r0x0d
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	MOVF	r0x0d, W
	MOVWF	POSTDEC1
	MOVF	r0x0c, W
	MOVWF	POSTDEC1
	MOVF	r0x0b, W
	MOVWF	POSTDEC1
	MOVF	r0x0a, W
	MOVWF	POSTDEC1
	MOVF	r0x09, W
	MOVWF	POSTDEC1
	MOVF	r0x08, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	CALL	_crc16
	MOVWF	r0x00
	MOVFF	PRODL, r0x01
	MOVLW	0x09
	ADDWF	FSR1L, F
	.line	141; protocol.c	for (i = 0; i < protocol_packets->num; i++) {
	MOVLW	0x09
	ADDWF	r0x04, F
	INCF	r0x03, F
	BRA	_00197_DS_
_00200_DS_:
	BANKSEL	_decode_frame_crc_1_1
	.line	148; protocol.c	crc[0] = '\0';
	CLRF	_decode_frame_crc_1_1, B
	.line	149; protocol.c	strncat(crc, protocol_frame + (len - (CRC_SIZE + STOP_SIZE)), CRC_SIZE);
	MOVLW	HIGH(_decode_frame_crc_1_1)
	MOVWF	r0x04
	MOVLW	LOW(_decode_frame_crc_1_1)
	MOVWF	r0x03
	MOVLW	0x80
	MOVWF	r0x05
	MOVLW	0xfa
	ADDWF	r0x06, F
	BTFSS	STATUS, 0
	DECF	r0x07, F
	CLRF	r0x08
	BTFSC	r0x07, 7
	SETF	r0x08
	BANKSEL	_protocol_frame
	MOVF	_protocol_frame, W, B
	ADDWF	r0x06, F
	BANKSEL	(_protocol_frame + 1)
	MOVF	(_protocol_frame + 1), W, B
	ADDWFC	r0x07, F
	BANKSEL	(_protocol_frame + 2)
	MOVF	(_protocol_frame + 2), W, B
	ADDWFC	r0x08, F
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x04
	MOVWF	POSTDEC1
	MOVF	r0x08, W
	MOVWF	POSTDEC1
	MOVF	r0x07, W
	MOVWF	POSTDEC1
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	CALL	_strncat
	MOVLW	0x08
	ADDWF	FSR1L, F
	.line	152; protocol.c	len = strlen(crc);
	MOVLW	HIGH(_decode_frame_crc_1_1)
	MOVWF	r0x04
	MOVLW	LOW(_decode_frame_crc_1_1)
	MOVWF	r0x03
	MOVLW	0x80
	MOVWF	r0x05
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	CALL	_strlen
	MOVWF	r0x03
	MOVFF	PRODL, r0x04
	MOVLW	0x03
	ADDWF	FSR1L, F
	MOVF	r0x03, W
	MOVWF	r0x02
	.line	153; protocol.c	received_crc_int = 0;
	CLRF	r0x03
	CLRF	r0x04
	.line	154; protocol.c	for (i = 1; i <= len; i++) {
	MOVLW	0x01
	MOVWF	r0x05
_00201_DS_:
	MOVF	r0x05, W
	SUBWF	r0x02, W
	BTFSS	STATUS, 0
	BRA	_00204_DS_
	.line	155; protocol.c	hex_buf[0] = crc[len - i];
	MOVF	r0x05, W
	SUBWF	r0x02, W
	MOVWF	r0x06
	CLRF	r0x07
	MOVLW	LOW(_decode_frame_crc_1_1)
	ADDWF	r0x06, F
	MOVLW	HIGH(_decode_frame_crc_1_1)
	ADDWFC	r0x07, F
	MOVFF	r0x06, FSR0L
	MOVFF	r0x07, FSR0H
	MOVFF	INDF0, r0x06
	MOVF	r0x06, W
	BANKSEL	_decode_frame_hex_buf_1_1
	MOVWF	_decode_frame_hex_buf_1_1, B
	BANKSEL	(_decode_frame_hex_buf_1_1 + 1)
	.line	156; protocol.c	hex_buf[1] = '\0';
	CLRF	(_decode_frame_hex_buf_1_1 + 1), B
	.line	157; protocol.c	received_crc_int |= (strtol(hex_buf, NULL, 16)) << (4 * (i - 1));
	MOVLW	HIGH(_decode_frame_hex_buf_1_1)
	MOVWF	r0x07
	MOVLW	LOW(_decode_frame_hex_buf_1_1)
	MOVWF	r0x06
	MOVLW	0x80
	MOVWF	r0x08
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x10
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVF	r0x08, W
	MOVWF	POSTDEC1
	MOVF	r0x07, W
	MOVWF	POSTDEC1
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	CALL	_strtol
	MOVWF	r0x06
	MOVFF	PRODL, r0x07
	MOVFF	PRODH, r0x08
	MOVFF	FSR0L, r0x09
	MOVLW	0x08
	ADDWF	FSR1L, F
	MOVFF	r0x05, r0x0a
	CLRF	r0x0b
	MOVLW	0xff
	ADDWF	r0x0a, F
	BTFSS	STATUS, 0
	DECF	r0x0b, F
	MOVF	r0x0b, W
	MOVWF	POSTDEC1
	MOVF	r0x0a, W
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x04
	MOVWF	POSTDEC1
	CALL	__mulint
	MOVWF	r0x0a
	MOVFF	PRODL, r0x0b
	MOVLW	0x04
	ADDWF	FSR1L, F
	MOVFF	r0x06, r0x0c
	MOVFF	r0x07, r0x0d
	MOVFF	r0x08, r0x0e
	MOVFF	r0x09, r0x0f
	MOVF	r0x0a, W
	BZ	_00229_DS_
	BN	_00232_DS_
	NEGF	WREG
	BCF	STATUS, 0
_00230_DS_:
	RLCF	r0x0c, F
	RLCF	r0x0d, F
	RLCF	r0x0e, F
	RLCF	r0x0f, F
	ADDLW	0x01
	BNC	_00230_DS_
	BRA	_00229_DS_
_00232_DS_:
	BCF	STATUS, 0
_00231_DS_:
	BTFSC	r0x0f, 7
	BSF	STATUS, 0
	RRCF	r0x0f, F
	RRCF	r0x0e, F
	RRCF	r0x0d, F
	RRCF	r0x0c, F
	ADDLW	0x01
	BNC	_00231_DS_
_00229_DS_:
	MOVFF	r0x03, r0x06
	MOVFF	r0x04, r0x07
	CLRF	r0x08
	CLRF	r0x09
	MOVF	r0x06, W
	IORWF	r0x0c, F
	MOVF	r0x07, W
	IORWF	r0x0d, F
	MOVF	r0x08, W
	IORWF	r0x0e, F
	MOVF	r0x09, W
	IORWF	r0x0f, F
	MOVF	r0x0c, W
	MOVWF	r0x03
	MOVF	r0x0d, W
	MOVWF	r0x04
	.line	154; protocol.c	for (i = 1; i <= len; i++) {
	INCF	r0x05, F
	BRA	_00201_DS_
_00204_DS_:
	.line	161; protocol.c	if (received_crc_int == crc_int) {	
	MOVF	r0x03, W
	XORWF	r0x00, W
	BNZ	_00234_DS_
	MOVF	r0x04, W
	XORWF	r0x01, W
	BZ	_00235_DS_
_00234_DS_:
	BRA	_00183_DS_
_00235_DS_:
	.line	162; protocol.c	return 1;
	MOVLW	0x01
	BRA	_00205_DS_
_00183_DS_:
	.line	165; protocol.c	return 0;
	CLRF	WREG
_00205_DS_:
	MOVFF	PREINC1, r0x0f
	MOVFF	PREINC1, r0x0e
	MOVFF	PREINC1, r0x0d
	MOVFF	PREINC1, r0x0c
	MOVFF	PREINC1, r0x0b
	MOVFF	PREINC1, r0x0a
	MOVFF	PREINC1, r0x09
	MOVFF	PREINC1, r0x08
	MOVFF	PREINC1, r0x07
	MOVFF	PREINC1, r0x06
	MOVFF	PREINC1, r0x05
	MOVFF	PREINC1, r0x04
	MOVFF	PREINC1, r0x03
	MOVFF	PREINC1, r0x02
	MOVFF	PREINC1, r0x01
	MOVFF	PREINC1, r0x00
	MOVFF	PREINC1, FSR2L
	RETURN	

; ; Starting pCode block
S_protocol__add_packet_to_protocol_encoder	code
_add_packet_to_protocol_encoder:
	.line	84; protocol.c	unsigned char add_packet_to_protocol_encoder(packet_t *p) {
	MOVFF	FSR2L, POSTDEC1
	MOVFF	FSR1L, FSR2L
	MOVFF	r0x00, POSTDEC1
	MOVFF	r0x01, POSTDEC1
	MOVFF	r0x02, POSTDEC1
	MOVFF	r0x03, POSTDEC1
	MOVFF	r0x04, POSTDEC1
	MOVFF	r0x05, POSTDEC1
	MOVFF	r0x06, POSTDEC1
	MOVFF	r0x07, POSTDEC1
	MOVFF	r0x08, POSTDEC1
	MOVFF	r0x09, POSTDEC1
	MOVLW	0x02
	MOVFF	PLUSW2, r0x00
	MOVLW	0x03
	MOVFF	PLUSW2, r0x01
	MOVLW	0x04
	MOVFF	PLUSW2, r0x02
	.line	87; protocol.c	protocol_packets->packet[protocol_packets->num].cmd = p->cmd;
	MOVFF	_protocol_packets, r0x03
	MOVFF	(_protocol_packets + 1), r0x04
	MOVFF	(_protocol_packets + 2), r0x05
	MOVFF	_protocol_packets, r0x06
	MOVFF	(_protocol_packets + 1), r0x07
	MOVFF	(_protocol_packets + 2), r0x08
	MOVLW	0x12
	ADDWF	r0x06, F
	MOVLW	0x00
	ADDWFC	r0x07, F
	MOVLW	0x00
	ADDWFC	r0x08, F
	MOVFF	r0x06, FSR0L
	MOVFF	r0x07, PRODL
	MOVF	r0x08, W
	CALL	__gptrget1
	MOVWF	r0x06
; ;multiply lit val:0x09 by variable r0x06 and store in r0x06
; ;Unrolled 8 X 8 multiplication
; ;FIXME: the function does not support result==WREG
	MOVF	r0x06, W
	MULLW	0x09
	MOVFF	PRODL, r0x06
	MOVF	r0x06, W
	ADDWF	r0x03, F
	CLRF	WREG
	ADDWFC	r0x04, F
	CLRF	WREG
	ADDWFC	r0x05, F
	MOVFF	r0x00, FSR0L
	MOVFF	r0x01, PRODL
	MOVF	r0x02, W
	CALL	__gptrget1
	MOVWF	r0x06
	MOVFF	r0x06, POSTDEC1
	MOVFF	r0x03, FSR0L
	MOVFF	r0x04, PRODL
	MOVF	r0x05, W
	CALL	__gptrput1
	.line	88; protocol.c	for (i = 0; i < PARAMS_LENGTH; i++) {
	INCF	r0x00, F
	BTFSC	STATUS, 0
	INCF	r0x01, F
	BTFSC	STATUS, 0
	INCF	r0x02, F
	CLRF	r0x03
_00165_DS_:
	MOVLW	0x08
	SUBWF	r0x03, W
	BTFSC	STATUS, 0
	BRA	_00168_DS_
	.line	89; protocol.c	protocol_packets->packet[protocol_packets->num].params[i] = p->params[i];
	MOVFF	_protocol_packets, r0x04
	MOVFF	(_protocol_packets + 1), r0x05
	MOVFF	(_protocol_packets + 2), r0x06
	MOVFF	_protocol_packets, r0x07
	MOVFF	(_protocol_packets + 1), r0x08
	MOVFF	(_protocol_packets + 2), r0x09
	MOVLW	0x12
	ADDWF	r0x07, F
	MOVLW	0x00
	ADDWFC	r0x08, F
	MOVLW	0x00
	ADDWFC	r0x09, F
	MOVFF	r0x07, FSR0L
	MOVFF	r0x08, PRODL
	MOVF	r0x09, W
	CALL	__gptrget1
	MOVWF	r0x07
; ;multiply lit val:0x09 by variable r0x07 and store in r0x07
; ;Unrolled 8 X 8 multiplication
; ;FIXME: the function does not support result==WREG
	MOVF	r0x07, W
	MULLW	0x09
	MOVFF	PRODL, r0x07
	MOVF	r0x07, W
	ADDWF	r0x04, F
	CLRF	WREG
	ADDWFC	r0x05, F
	CLRF	WREG
	ADDWFC	r0x06, F
	INCF	r0x04, F
	BTFSC	STATUS, 0
	INCF	r0x05, F
	BTFSC	STATUS, 0
	INCF	r0x06, F
	MOVF	r0x03, W
	ADDWF	r0x04, F
	CLRF	WREG
	ADDWFC	r0x05, F
	CLRF	WREG
	ADDWFC	r0x06, F
	MOVF	r0x03, W
	ADDWF	r0x00, W
	MOVWF	r0x07
	CLRF	WREG
	ADDWFC	r0x01, W
	MOVWF	r0x08
	CLRF	WREG
	ADDWFC	r0x02, W
	MOVWF	r0x09
	MOVFF	r0x07, FSR0L
	MOVFF	r0x08, PRODL
	MOVF	r0x09, W
	CALL	__gptrget1
	MOVWF	r0x07
	MOVFF	r0x07, POSTDEC1
	MOVFF	r0x04, FSR0L
	MOVFF	r0x05, PRODL
	MOVF	r0x06, W
	CALL	__gptrput1
	.line	88; protocol.c	for (i = 0; i < PARAMS_LENGTH; i++) {
	INCF	r0x03, F
	BRA	_00165_DS_
_00168_DS_:
	.line	91; protocol.c	protocol_packets->num++;
	MOVFF	_protocol_packets, r0x00
	MOVFF	(_protocol_packets + 1), r0x01
	MOVFF	(_protocol_packets + 2), r0x02
	MOVLW	0x12
	ADDWF	r0x00, F
	MOVLW	0x00
	ADDWFC	r0x01, F
	MOVLW	0x00
	ADDWFC	r0x02, F
	MOVFF	r0x00, FSR0L
	MOVFF	r0x01, PRODL
	MOVF	r0x02, W
	CALL	__gptrget1
	MOVWF	r0x03
	INCF	r0x03, F
	MOVFF	r0x03, POSTDEC1
	MOVFF	r0x00, FSR0L
	MOVFF	r0x01, PRODL
	MOVF	r0x02, W
	CALL	__gptrput1
	.line	93; protocol.c	return 1;
	MOVLW	0x01
	MOVFF	PREINC1, r0x09
	MOVFF	PREINC1, r0x08
	MOVFF	PREINC1, r0x07
	MOVFF	PREINC1, r0x06
	MOVFF	PREINC1, r0x05
	MOVFF	PREINC1, r0x04
	MOVFF	PREINC1, r0x03
	MOVFF	PREINC1, r0x02
	MOVFF	PREINC1, r0x01
	MOVFF	PREINC1, r0x00
	MOVFF	PREINC1, FSR2L
	RETURN	

; ; Starting pCode block
S_protocol__add_to_protocol_decoder	code
_add_to_protocol_decoder:
	.line	35; protocol.c	unsigned char add_to_protocol_decoder(unsigned char s) {
	MOVFF	FSR2L, POSTDEC1
	MOVFF	FSR1L, FSR2L
	MOVFF	r0x00, POSTDEC1
	MOVFF	r0x01, POSTDEC1
	MOVFF	r0x02, POSTDEC1
	MOVFF	r0x03, POSTDEC1
	MOVFF	r0x04, POSTDEC1
	MOVFF	r0x05, POSTDEC1
	MOVFF	r0x06, POSTDEC1
	MOVLW	0x02
	MOVFF	PLUSW2, r0x00
	.line	37; protocol.c	if (s == ':') {
	MOVF	r0x00, W
	XORLW	0x3a
	BNZ	_00139_DS_
	.line	39; protocol.c	protocol_frame[0] = '\0';
	MOVFF	_protocol_frame, r0x01
	MOVFF	(_protocol_frame + 1), r0x02
	MOVFF	(_protocol_frame + 2), r0x03
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVFF	r0x01, FSR0L
	MOVFF	r0x02, PRODL
	MOVF	r0x03, W
	CALL	__gptrput1
	.line	40; protocol.c	buf[0] = s;
	MOVF	r0x00, W
	BANKSEL	_add_to_protocol_decoder_buf_1_1
	MOVWF	_add_to_protocol_decoder_buf_1_1, B
	BANKSEL	(_add_to_protocol_decoder_buf_1_1 + 1)
	.line	41; protocol.c	buf[1] = '\0';
	CLRF	(_add_to_protocol_decoder_buf_1_1 + 1), B
	.line	42; protocol.c	strcat(protocol_frame, buf);
	MOVFF	_protocol_frame, r0x01
	MOVFF	(_protocol_frame + 1), r0x02
	MOVFF	(_protocol_frame + 2), r0x03
	MOVLW	HIGH(_add_to_protocol_decoder_buf_1_1)
	MOVWF	r0x05
	MOVLW	LOW(_add_to_protocol_decoder_buf_1_1)
	MOVWF	r0x04
	MOVLW	0x80
	MOVWF	r0x06
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	CALL	_strcat
	MOVLW	0x06
	ADDWF	FSR1L, F
	.line	43; protocol.c	state = start_received;
	MOVLW	0x01
	BANKSEL	_state
	MOVWF	_state, B
	BRA	_00140_DS_
_00139_DS_:
	BANKSEL	_state
	.line	45; protocol.c	else if (state == start_received) {
	MOVF	_state, W, B
	XORLW	0x01
	BZ	_00153_DS_
	BRA	_00136_DS_
_00153_DS_:
	.line	46; protocol.c	if (s == '\r') {
	MOVF	r0x00, W
	XORLW	0x0d
	BNZ	_00126_DS_
	.line	47; protocol.c	buf[0] = s;
	MOVF	r0x00, W
	BANKSEL	_add_to_protocol_decoder_buf_1_1
	MOVWF	_add_to_protocol_decoder_buf_1_1, B
	BANKSEL	(_add_to_protocol_decoder_buf_1_1 + 1)
	.line	48; protocol.c	buf[1] = '\0';
	CLRF	(_add_to_protocol_decoder_buf_1_1 + 1), B
	.line	49; protocol.c	strcat(protocol_frame, buf);
	MOVFF	_protocol_frame, r0x01
	MOVFF	(_protocol_frame + 1), r0x02
	MOVFF	(_protocol_frame + 2), r0x03
	MOVLW	HIGH(_add_to_protocol_decoder_buf_1_1)
	MOVWF	r0x05
	MOVLW	LOW(_add_to_protocol_decoder_buf_1_1)
	MOVWF	r0x04
	MOVLW	0x80
	MOVWF	r0x06
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	CALL	_strcat
	MOVLW	0x06
	ADDWF	FSR1L, F
	.line	50; protocol.c	state = cr_received;
	MOVLW	0x02
	BANKSEL	_state
	MOVWF	_state, B
	BRA	_00140_DS_
_00126_DS_:
	.line	53; protocol.c	buf[0] = s;
	MOVF	r0x00, W
	BANKSEL	_add_to_protocol_decoder_buf_1_1
	MOVWF	_add_to_protocol_decoder_buf_1_1, B
	BANKSEL	(_add_to_protocol_decoder_buf_1_1 + 1)
	.line	54; protocol.c	buf[1] = '\0';
	CLRF	(_add_to_protocol_decoder_buf_1_1 + 1), B
	.line	55; protocol.c	if ((strlen(protocol_frame) + strlen(buf)) < FRAME_LENGTH) {
	MOVFF	_protocol_frame, r0x01
	MOVFF	(_protocol_frame + 1), r0x02
	MOVFF	(_protocol_frame + 2), r0x03
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	CALL	_strlen
	MOVWF	r0x01
	MOVFF	PRODL, r0x02
	MOVLW	0x03
	ADDWF	FSR1L, F
	MOVLW	HIGH(_add_to_protocol_decoder_buf_1_1)
	MOVWF	r0x04
	MOVLW	LOW(_add_to_protocol_decoder_buf_1_1)
	MOVWF	r0x03
	MOVLW	0x80
	MOVWF	r0x05
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	CALL	_strlen
	MOVWF	r0x03
	MOVFF	PRODL, r0x04
	MOVLW	0x03
	ADDWF	FSR1L, F
	MOVF	r0x03, W
	ADDWF	r0x01, F
	MOVF	r0x04, W
	ADDWFC	r0x02, F
	MOVF	r0x02, W
	ADDLW	0x80
	ADDLW	0x80
	BNZ	_00156_DS_
	MOVLW	0x2f
	SUBWF	r0x01, W
_00156_DS_:
	BC	_00123_DS_
	.line	56; protocol.c	strcat(protocol_frame, buf);
	MOVFF	_protocol_frame, r0x01
	MOVFF	(_protocol_frame + 1), r0x02
	MOVFF	(_protocol_frame + 2), r0x03
	MOVLW	HIGH(_add_to_protocol_decoder_buf_1_1)
	MOVWF	r0x05
	MOVLW	LOW(_add_to_protocol_decoder_buf_1_1)
	MOVWF	r0x04
	MOVLW	0x80
	MOVWF	r0x06
	MOVF	r0x06, W
	MOVWF	POSTDEC1
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	CALL	_strcat
	MOVLW	0x06
	ADDWF	FSR1L, F
	BRA	_00140_DS_
_00123_DS_:
	BANKSEL	_state
	.line	60; protocol.c	state = idle;
	CLRF	_state, B
	.line	61; protocol.c	return 0;
	CLRF	WREG
	BRA	_00141_DS_
_00136_DS_:
	BANKSEL	_state
	.line	65; protocol.c	else if (state == cr_received) {
	MOVF	_state, W, B
	XORLW	0x02
	BNZ	_00140_DS_
	.line	66; protocol.c	if (s == '\n') {
	MOVF	r0x00, W
	XORLW	0x0a
	BNZ	_00140_DS_
	.line	67; protocol.c	state = n_received;
	MOVLW	0x03
	BANKSEL	_state
	MOVWF	_state, B
	.line	68; protocol.c	buf[0] = s;
	MOVF	r0x00, W
	BANKSEL	_add_to_protocol_decoder_buf_1_1
	MOVWF	_add_to_protocol_decoder_buf_1_1, B
	BANKSEL	(_add_to_protocol_decoder_buf_1_1 + 1)
	.line	69; protocol.c	buf[1] = '\0';
	CLRF	(_add_to_protocol_decoder_buf_1_1 + 1), B
	.line	70; protocol.c	strcat(protocol_frame, buf);
	MOVFF	_protocol_frame, r0x00
	MOVFF	(_protocol_frame + 1), r0x01
	MOVFF	(_protocol_frame + 2), r0x02
	MOVLW	HIGH(_add_to_protocol_decoder_buf_1_1)
	MOVWF	r0x04
	MOVLW	LOW(_add_to_protocol_decoder_buf_1_1)
	MOVWF	r0x03
	MOVLW	0x80
	MOVWF	r0x05
	MOVF	r0x05, W
	MOVWF	POSTDEC1
	MOVF	r0x04, W
	MOVWF	POSTDEC1
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	CALL	_strcat
	MOVLW	0x06
	ADDWF	FSR1L, F
	.line	72; protocol.c	if (decode_frame()) {
	CALL	_decode_frame
	MOVWF	r0x00
	MOVF	r0x00, W
	BZ	_00129_DS_
	.line	73; protocol.c	state = data_ready;
	MOVLW	0x04
	BANKSEL	_state
	MOVWF	_state, B
	BRA	_00140_DS_
_00129_DS_:
	BANKSEL	_state
	.line	76; protocol.c	state = idle;
	CLRF	_state, B
_00140_DS_:
	.line	81; protocol.c	return 1;
	MOVLW	0x01
_00141_DS_:
	MOVFF	PREINC1, r0x06
	MOVFF	PREINC1, r0x05
	MOVFF	PREINC1, r0x04
	MOVFF	PREINC1, r0x03
	MOVFF	PREINC1, r0x02
	MOVFF	PREINC1, r0x01
	MOVFF	PREINC1, r0x00
	MOVFF	PREINC1, FSR2L
	RETURN	

; ; Starting pCode block
S_protocol__get_protocol_data	code
_get_protocol_data:
	.line	23; protocol.c	unsigned char get_protocol_data(packets_t *p) {
	MOVFF	FSR2L, POSTDEC1
	MOVFF	FSR1L, FSR2L
	BANKSEL	_state
	.line	24; protocol.c	if (state == data_ready) {
	MOVF	_state, W, B
	XORLW	0x04
	BNZ	_00111_DS_
_00117_DS_:
	BANKSEL	_state
	.line	25; protocol.c	state = idle;
	CLRF	_state, B
	.line	27; protocol.c	return 1;
	MOVLW	0x01
	BRA	_00113_DS_
_00111_DS_:
	.line	30; protocol.c	return 0;
	CLRF	WREG
_00113_DS_:
	MOVFF	PREINC1, FSR2L
	RETURN	

; ; Starting pCode block
S_protocol__init_protocol	code
_init_protocol:
	.line	15; protocol.c	void init_protocol(packets_t *p, unsigned char *frame) {
	MOVFF	FSR2L, POSTDEC1
	MOVFF	FSR1L, FSR2L
	MOVFF	r0x00, POSTDEC1
	MOVFF	r0x01, POSTDEC1
	MOVFF	r0x02, POSTDEC1
	MOVLW	0x02
	MOVFF	PLUSW2, _protocol_packets
	MOVLW	0x03
	MOVFF	PLUSW2, (_protocol_packets + 1)
	MOVLW	0x04
	MOVFF	PLUSW2, (_protocol_packets + 2)
	MOVLW	0x05
	MOVFF	PLUSW2, _protocol_frame
	MOVLW	0x06
	MOVFF	PLUSW2, (_protocol_frame + 1)
	MOVLW	0x07
	MOVFF	PLUSW2, (_protocol_frame + 2)
	.line	17; protocol.c	protocol_packets->num = 0;
	MOVFF	_protocol_packets, r0x00
	MOVFF	(_protocol_packets + 1), r0x01
	MOVFF	(_protocol_packets + 2), r0x02
	MOVLW	0x12
	ADDWF	r0x00, F
	MOVLW	0x00
	ADDWFC	r0x01, F
	MOVLW	0x00
	ADDWFC	r0x02, F
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVFF	r0x00, FSR0L
	MOVFF	r0x01, PRODL
	MOVF	r0x02, W
	CALL	__gptrput1
	.line	19; protocol.c	protocol_frame[0] = '\0';
	MOVFF	_protocol_frame, r0x00
	MOVFF	(_protocol_frame + 1), r0x01
	MOVFF	(_protocol_frame + 2), r0x02
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVFF	r0x00, FSR0L
	MOVFF	r0x01, PRODL
	MOVF	r0x02, W
	CALL	__gptrput1
	BANKSEL	_state
	.line	20; protocol.c	state = idle;
	CLRF	_state, B
	MOVFF	PREINC1, r0x02
	MOVFF	PREINC1, r0x01
	MOVFF	PREINC1, r0x00
	MOVFF	PREINC1, FSR2L
	RETURN	

; ; Starting pCode block
__str_0:
	DB	0x25, 0x64, 0x00
; ; Starting pCode block
__str_1:
	DB	0x3a, 0x00
; ; Starting pCode block
__str_2:
	DB	0x25, 0x30, 0x32, 0x78, 0x00
; ; Starting pCode block
__str_3:
	DB	0x25, 0x30, 0x32, 0x78, 0x25, 0x30, 0x32, 0x78, 0x00
; ; Starting pCode block
__str_4:
	DB	0x0d, 0x00
; ; Starting pCode block
__str_5:
	DB	0x0a, 0x00


; Statistics:
; code size:	 5048 (0x13b8) bytes ( 3.85%)
;           	 2524 (0x09dc) words
; udata size:	   59 (0x003b) bytes ( 3.29%)
; access size:	   16 (0x0010) bytes


	end
